cari xpath javascript:(function(){ let lastHighlight = null; function getXPath(el) { if (el.id) return `//*[@id="${el.id}"]`; let parts = []; while (el && el.nodeType === Node.ELEMENT_NODE) { let tag = el.tagName.toLowerCase(); let index = 1; let sibling = el.previousElementSibling; while (sibling) { if (sibling.tagName.toLowerCase() === tag) index++; sibling = sibling.previousElementSibling; } parts.unshift(tag + (index > 1 ?%20`[${index}]`%20:%20%27%27));%20%20%20%20%20%20el%20=%20el.parentNode;%20%20%20%20}%20%20%20%20return%20%27/%27%20+%20parts.join(%27/%27);%20%20}%20%20function%20copyToClipboard(text)%20{%20%20%20%20navigator.clipboard.writeText(text).then(()%20=%3E%20{%20%20%20%20%20%20alert(%27XPath%20telah%20disalin%20ke%20clipboard:\n\n%27%20+%20text);%20%20%20%20}).catch(err%20=%3E%20{%20%20%20%20%20%20console.error(%27Gagal%20menyalin:%27,%20err);%20%20%20%20%20%20prompt(%27Salin%20XPath%20secara%20manual:%27,%20text);%20%20%20%20});%20%20}%20%20function%20clickHandler(event)%20{%20%20%20%20event.preventDefault();%20%20%20%20event.stopPropagation();%20%20%20%20if%20(lastHighlight)%20lastHighlight.style.outline%20=%20%27%27;%20%20%20%20lastHighlight%20=%20event.target;%20%20%20%20lastHighlight.style.outline%20=%20%273px%20solid%20red%27;%20%20%20%20let%20xpath%20=%20getXPath(event.target);%20%20%20%20copyToClipboard(xpath);%20%20}%20%20document.body.addEventListener(%27click%27,%20clickHandler,%20true);%20%20alert(%27XPath%20detector%20aktif!%20Klik%20elemen%20di%20halaman%20untuk%20dapatkan%20&%20salin%20XPath.\n\nReload%20halaman%20untuk%20mematikan.%27);})(); ========================================================================== cari css javascript:(function() { function getUniqueSelector(el) { if (el.id) return '#'%20+%20el.id;%20%20%20%20if%20(el%20===%20document.body)%20return%20'body';%20%20%20%20let%20path%20=%20[],%20parent;%20%20%20%20while%20(el%20&&%20el.nodeType%20===%20Node.ELEMENT_NODE)%20{%20%20%20%20%20%20let%20selector%20=%20el.nodeName.toLowerCase();%20%20%20%20%20%20if%20(el.id)%20{%20%20%20%20%20%20%20%20selector%20+=%20'#'%20+%20el.id;%20%20%20%20%20%20%20%20path.unshift(selector);%20%20%20%20%20%20%20%20break;%20%20%20%20%20%20}%20else%20{%20%20%20%20%20%20%20%20parent%20=%20el.parentNode;%20%20%20%20%20%20%20%20if%20(parent)%20{%20%20%20%20%20%20%20%20%20%20let%20siblings%20=%20Array.from(parent.children).filter(e%20=%3E%20e.nodeName%20===%20el.nodeName);%20%20%20%20%20%20%20%20%20%20if%20(siblings.length%20%3E%201)%20{%20%20%20%20%20%20%20%20%20%20%20%20selector%20+=%20%60:nth-of-type(${siblings.indexOf(el)%20+%201})%60;%20%20%20%20%20%20%20%20%20%20}%20%20%20%20%20%20%20%20}%20%20%20%20%20%20}%20%20%20%20%20%20path.unshift(selector);%20%20%20%20%20%20el%20=%20el.parentNode;%20%20%20%20}%20%20%20%20return%20path.join('%20%3E%20');%20%20}%20%20function%20copyToClipboard(text)%20{%20%20%20%20const%20textarea%20=%20document.createElement(%22textarea%22);%20%20%20%20textarea.style.position%20=%20'fixed';%20%20%20%20textarea.style.opacity%20=%200;%20%20%20%20textarea.value%20=%20text;%20%20%20%20document.body.appendChild(textarea);%20%20%20%20textarea.focus();%20%20%20%20textarea.select();%20%20%20%20try%20{%20%20%20%20%20%20const%20successful%20=%20document.execCommand('copy');%20%20%20%20%20%20alert(successful%20?%20'Selector%20disalin%20ke%20clipboard:\n'%20+%20text%20:%20'Gagal%20menyalin%20selector');%20%20%20%20}%20catch%20(err)%20{%20%20%20%20%20%20alert('Gagal%20menyalin%20selector:%20'%20+%20err);%20%20%20%20}%20%20%20%20document.body.removeChild(textarea);%20%20}%20%20alert('Klik%20elemen%20untuk%20mendapatkan%20dan%20menyalin%20CSS%20selector');%20%20document.addEventListener('click',%20function%20handler(e)%20{%20%20%20%20e.preventDefault();%20%20%20%20e.stopPropagation();%20%20%20%20const%20selector%20=%20getUniqueSelector(e.target);%20%20%20%20console.log('Selector:',%20selector);%20%20%20%20copyToClipboard(selector);%20%20%20%20document.removeEventListener('click',%20handler,%20true);%20%20},%20true);})(); ========================================================================== cari page berdasarkan xpath javascript:(function(){ function getElementByXPath(xpath) { try { return document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; } catch (e) { alert('XPath tidak valid:\n' + e); return null; } } function highlightElement(el) { if (!el) { alert('Elemen tidak ditemukan.'); return; } el.scrollIntoView({ behavior: 'smooth', block: 'center' }); el.style.outline = '3px solid lime'; el.style.backgroundColor = 'rgba(144,238,144,0.3)'; alert('Elemen ditemukan dan disorot.'); } let xpath = prompt("Masukkan XPath:"); if (xpath) { let el = getElementByXPath(xpath); highlightElement(el); }})(); ========================================================================== xpath kumplit javascript:(function(){let lastHighlight=null;function getXPath(el){if(!el||el.nodeType!==1)return '';if(el.id&&!/^_/.test(el.id)&&el.id.length>5)return `//*[@id="${el.id}"]`;let parts=[];while(el&&el.nodeType===1){let tag=el.tagName.toLowerCase(),i=1,s=el.previousElementSibling;while(s){if(s.tagName.toLowerCase()===tag)i++;s=s.previousElementSibling}parts.unshift(`${tag}[${i}]`);el=el.parentNode}return '/'+parts.join('/')}function copyToClipboard(t){navigator.clipboard.writeText(t).then(()=>{alert('XPath telah disalin ke clipboard:\n\n'+t)}).catch(e=>{console.error('Gagal menyalin:',e);prompt('Salin XPath secara manual:',t)})}function highlightElement(el){if(!el){alert('Elemen tidak ditemukan.');return}if(lastHighlight){lastHighlight.style.outline='';lastHighlight.style.backgroundColor=''}if(el.tagName.toLowerCase()!=='input'){let inputChild=el.querySelector('input');if(inputChild)el=inputChild}lastHighlight=el;el.scrollIntoView({behavior:'smooth',block:'center'});el.style.outline='3px solid lime';el.style.backgroundColor='rgba(144,238,144,0.3)';alert('Elemen ditemukan dan disorot.')}function getElementByXPath(xp){try{return document.evaluate(xp,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}catch(e){alert('XPath tidak valid:\n'+e);return null}}function clickHandler(e){e.preventDefault();e.stopPropagation();if(lastHighlight){lastHighlight.style.outline='';lastHighlight.style.backgroundColor=''}lastHighlight=e.target;lastHighlight.style.outline='3px solid red';let xp=getXPath(e.target);copyToClipboard(xp)}let mode=prompt("Pilih mode:\n1 - Klik elemen untuk ambil XPath\n2 - Masukkan XPath untuk cari elemen","1");if(mode==="1"){document.body.addEventListener('click',clickHandler,true);alert('XPath klik-mode aktif! Klik elemen di halaman untuk dapatkan XPath.\n\nReload halaman untuk menonaktifkan.')}else if(mode==="2"){let xp=prompt("Masukkan XPath:");if(xp){let el=getElementByXPath(xp);highlightElement(el)}}else{alert("Mode tidak dikenali. Gunakan 1 atau 2.")}})(); ========================================================================== cari upload tersembunyi javascript:(function(){ const fileInputs = Array.from(document.querySelectorAll('input[type="file"]')); alert(`Ditemukan ${fileInputs.length} input file.`); fileInputs.forEach((input, i) => { const style = window.getComputedStyle(input); const visible = style.display !== 'none' && style.visibility !== 'hidden' && input.offsetParent !== null; console.log(`Input #${i+1}:%20visible=${visible},%20id=${input.id%20||%20'(no%20id)'},%20class=${input.className}%60);%20%20%20%20console.log(input);%20%20});%20%20if(fileInputs.length%20%3E%200){%20%20%20%20fileInputs.forEach(input%20=%3E%20{%20%20%20%20%20%20input.style.display%20=%20'block';%20%20%20%20%20%20input.style.visibility%20=%20'visible';%20%20%20%20%20%20input.style.opacity%20=%20'1';%20%20%20%20%20%20input.style.position%20=%20'static';%20%20%20%20%20%20input.style.height%20=%20'auto';%20%20%20%20%20%20input.style.width%20=%20'auto';%20%20%20%20%20%20input.style.zIndex%20=%20'9999';%20%20%20%20});%20%20%20%20alert('Semua%20input%20file%20sudah%20di-unhide,%20cek%20console%20(F12)%20ya!');%20%20}%20else%20{%20%20%20%20alert('Tidak%20ditemukan%20input%20file%20di%20halaman%20ini.');%20%20}})(); ==========================================================================